#ifndef SERIAL_H
#define SERIAL_H

#include <QMainWindow>
#include <QDebug>
#include <unistd.h>
#include <signal.h>
#include "serialThread.h"
#include <QProcess>
#include <QFileDialog>

namespace Ui {
    class serial;
}

class serial : public QMainWindow {
    Q_OBJECT
public:
    serial(QWidget *parent = 0);
    ~serial();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::serial *ui;
    QString portName;
    SerialThread *myserial;
    BaudRateType mybaud;
    DataBitsType mydatabits;
    ParityType   myparity,;
    StopBitsType mystopbits;
    FlowType     myflow;
    long         mytimeout;
    QProcess    *dnw;
    QString     dnwfile;
    QStringList  args;

private slots:
    void on_sendMsgBtn_clicked();
    void getStr(QByteArray str);
    void openSerial();
    void closeSerial();
    void USBDown();
    void About();
signals:
    void sendtext(QString str);
};

#endif // SERIAL_H
